
<style>
  .style_table{border:1px solid #cbcbcb;  border-collapse:collapse; text-align:center;}
  .style_table td{border:1px solid #cbcbcb; padding:5px 10px 5px 10px;}
  .style_tr{background-color:#2a7d9f; color:#fff;}
  .style_x{ background-color:#d7e4ec; color:#083c6e;}
  .style_sd{ background-color:#EFEFEF; color:#083c6e;}
</style>

<% if @norms.size == 0 %>
<% else %>

<div>
  <b>常模</b><br/><br/>

  <table border="0" cellspacing="0" cellpadding="0" id="normsTable" class="style_table">
    <% if @test.norm_info.consider_item != NORM_ITEM_TYPE_NUM %>
    <tr class="style_tr">
      <% if @test.norm_info.consider_age %>
      <td></td>
      <% end %>
      <% if @test.norm_info.consider_sex %>
      <td></td>
      <% end %>
      <% for name in @norms[0].attribute_names %>
        <% if name.include?("item")%>
          <% if @test.norm_info.consider_item == NORM_ITEM_TYPE_PART %>
            <td colspan="2"><%= Part.find(name[4, name.length]).name %> </td>
          <% end %>
          <% if @test.norm_info.consider_item == NORM_ITEM_TYPE_DIMEN %>
            <td colspan="2"><%= Dimen.find(name[4, name.length]).name %> </td>
          <% end %>
        <% end %>
      <% end %>
    </tr>
    <% end %>

    <tr>
      <% if @test.norm_info.consider_age %>
      <td>年龄</td>
      <% end %>
      <% if @test.norm_info.consider_sex %>
      <td>性别</td>
      <% end %>
      <% for name in @norms[0].attribute_names %>
        <% if name.include?("item")%>
        <td class="style_x">X</td>
        <td class="style_sd">SD</td>
        <% end %>
      <% end %>
    </tr>

    <% for norm in @norms %>
    <tr>
      <% if @test.norm_info.consider_age %>
      <td><%= norm["age"]%> </td>
      <% end %>
      <% if @test.norm_info.consider_sex %>
      <td><%= norm["sex"] %> </td>
      <% end %>
      <% for name in @norms[0].attribute_names %>
        <% if name.include?("item")%>
        <td class="style_x"><%= norm[name].split(",")[0] %></td>
        <td class="style_sd"><%= norm[name].split(",")[1] %></td>
        <% end %>
      <% end%>
    </tr>
    <% end %>
  </table>
  
</div>

<% end %>
<!--
<ul id="list_ul" style="margin-left:20px">

      
  <table width="440" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td>性别</td>
      <td>年龄</td>

      <td>统计项目</td>
      <td>样本数</td>
      <td>样本均数</td>
      <td>样本标准差</td>
      
    </tr>

<% if @test.norms.size == 0 %>
  还没有题目
<% end %>

<% i = 0 %>
<% @test.norms.each do |n| %>
  <% i += 1 %>
<li style="list-style-type:none">

    <tr id="item_<%=n.id%>">
      <td>
        <%= n.sex %>
      </td>
      <td>
        <% if n.age_start == 0 %>
          不考虑
        <% else %>
          <%= n.age_start %>-<%= n.age_end %>
        <% end %>
      </td>
      <td>
        统计项目
      </td>
      <td>
        <%= n.specimen_num %>
      </td>
      <td>
        <%= n.specimen_avg %>
      </td>
      <td>
        <%= n.specimen_standard_deviation %>
      </td>
    </tr>    
</li>

<% end %>
    
    <tr><td height="10"></td></tr>
    
  </table>

</ul>
-->


<script>
  function heighlight(el){
    new Effect.Highlight(el, {duration: 1.5})
  }
  
  if(null != "<%= @heighlight_id %>" && "" != "<%= @heighlight_id %>") {
    heighlight("item_<%= @heighlight_id %>");
  }
</script>

